<html>
<head>
<title>TestNG:  用户登录接口</title>
<link href="../testng.css" rel="stylesheet" type="text/css" />
<link href="../my-testng.css" rel="stylesheet" type="text/css" />

<style type="text/css">
.log { display: none;} 
.stack-trace { display: none;} 
</style>
<script type="text/javascript">
<!--
function flip(e) {
  current = e.style.display;
  if (current == 'block') {
    e.style.display = 'none';
    return 0;
  }
  else {
    e.style.display = 'block';
    return 1;
  }
}

function toggleBox(szDivId, elem, msg1, msg2)
{
  var res = -1;  if (document.getElementById) {
    res = flip(document.getElementById(szDivId));
  }
  else if (document.all) {
    // this is the way old msie versions work
    res = flip(document.all[szDivId]);
  }
  if(elem) {
    if(res == 0) elem.innerHTML = msg1; else elem.innerHTML = msg2;
  }

}

function toggleAllBoxes() {
  if (document.getElementsByTagName) {
    d = document.getElementsByTagName('div');
    for (i = 0; i < d.length; i++) {
      if (d[i].className == 'log') {
        flip(d[i]);
      }
    }
  }
}

// -->
</script>

</head>
<body>
<h2 align='center'>用户登录接口</h2><table border='1' align="center">
<tr>
<td>Tests passed/Failed/Skipped:</td><td>4/3/0</td>
</tr><tr>
<td>Started on:</td><td>Tue Oct 30 17:13:16 CST 2018</td>
</tr>
<tr><td>Total time:</td><td>41 seconds (41347 ms)</td>
</tr><tr>
<td>Included groups:</td><td></td>
</tr><tr>
<td>Excluded groups:</td><td></td>
</tr>
</table><p/>
<small><i>(Hover the method name to see the test class name)</i></small><p/>
<table width='100%' border='1' class='invocation-failed'>
<tr><td colspan='4' align='center'><b>FAILED TESTS</b></td></tr>
<tr><td><b>Test method</b></td>
<td width="30%"><b>Exception</b></td>
<td width="10%"><b>Time (seconds)</b></td>
<td><b>Instance</b></td>
</tr>
<tr>
<td title='TestCases2.Login2.Case2()'><b>Case2</b><br>Test class: TestCases2.Login2<br/>
<a href="#Output-908654624" onClick='toggleBox("Output-908654624", this, "Show output", "Hide output");'>Show output</a>

<a href="#Output-908654624" onClick="toggleAllBoxes();">Show all outputs</a>
<div class='log' id="Output-908654624">
用例ID: 2<br/>
用例名称: 使用空值的账号，空值的密码，无法正常登录成功，且接口返回的实际结果都正确<br/>
请求地址: http://120.79.232.23:8000/api/user/login<br/>
请求方式: POST<br/>
请求参数: username=&password=<br/>
返回结果: {"username":["该字段不能为空。"],"password":["该字段不能为空。"],"code":400}<br/>
</div>
</td>
<td><div><pre>java.lang.AssertionError: msg =&gt;Expected 【账号和密码不能为空】 but found 【null】
	at org.testng.Assert.fail(Assert.java:94)
	at com.jmoney.luckeylink.handler.Login_Handler.checkEquals(Login_Handler.java:312)
	at com.jmoney.luckeylink.handler.Login_Handler.Login(Login_Handler.java:288)
	at TestCases2.Login2.Case2(Login2.java:23)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
	at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:54)
	at org.testng.internal.InvokeMethodRunnable.run(InvokeMethodRunnable.java:44)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
</pre></div><a href='#' onClick='toggleBox("stack-trace908654624", this, "Click to show all stack frames", "Click to hide stack frames")'>Click to show all stack frames</a>
<div class='stack-trace' id='stack-trace908654624'><pre>java.lang.AssertionError: msg =&gt;Expected 【账号和密码不能为空】 but found 【null】
	at org.testng.Assert.fail(Assert.java:94)
	at com.jmoney.luckeylink.handler.Login_Handler.checkEquals(Login_Handler.java:312)
	at com.jmoney.luckeylink.handler.Login_Handler.Login(Login_Handler.java:288)
	at TestCases2.Login2.Case2(Login2.java:23)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
	at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:54)
	at org.testng.internal.InvokeMethodRunnable.run(InvokeMethodRunnable.java:44)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
</pre></div></td>
<td>2</td>
<td>TestCases2.Login2@5649fd9b</td></tr>
<tr>
<td title='TestCases2.Login2.Case3()'><b>Case3</b><br>Test class: TestCases2.Login2<br/>
<a href="#Output-416919294" onClick='toggleBox("Output-416919294", this, "Show output", "Hide output");'>Show output</a>

<a href="#Output-416919294" onClick="toggleAllBoxes();">Show all outputs</a>
<div class='log' id="Output-416919294">
用例ID: 3<br/>
用例名称: 使用空值的账号，正确的密码，无法正常登录成功，且接口返回的实际结果都正确<br/>
请求地址: http://120.79.232.23:8000/api/user/login<br/>
请求方式: POST<br/>
请求参数: username=&password=admin369874125<br/>
返回结果: {"username":["该字段不能为空。"],"code":400}<br/>
</div>
</td>
<td><div><pre>java.lang.AssertionError: msg =&gt;Expected 【账号不能为空】 but found 【null】
	at org.testng.Assert.fail(Assert.java:94)
	at com.jmoney.luckeylink.handler.Login_Handler.checkEquals(Login_Handler.java:312)
	at com.jmoney.luckeylink.handler.Login_Handler.Login(Login_Handler.java:288)
	at TestCases2.Login2.Case3(Login2.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
	at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:54)
	at org.testng.internal.InvokeMethodRunnable.run(InvokeMethodRunnable.java:44)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
</pre></div><a href='#' onClick='toggleBox("stack-trace416919294", this, "Click to show all stack frames", "Click to hide stack frames")'>Click to show all stack frames</a>
<div class='stack-trace' id='stack-trace416919294'><pre>java.lang.AssertionError: msg =&gt;Expected 【账号不能为空】 but found 【null】
	at org.testng.Assert.fail(Assert.java:94)
	at com.jmoney.luckeylink.handler.Login_Handler.checkEquals(Login_Handler.java:312)
	at com.jmoney.luckeylink.handler.Login_Handler.Login(Login_Handler.java:288)
	at TestCases2.Login2.Case3(Login2.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
	at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:54)
	at org.testng.internal.InvokeMethodRunnable.run(InvokeMethodRunnable.java:44)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
</pre></div></td>
<td>2</td>
<td>TestCases2.Login2@5649fd9b</td></tr>
<tr>
<td title='TestCases2.Login2.Case4()'><b>Case4</b><br>Test class: TestCases2.Login2<br/>
<a href="#Output-1127178392" onClick='toggleBox("Output-1127178392", this, "Show output", "Hide output");'>Show output</a>

<a href="#Output-1127178392" onClick="toggleAllBoxes();">Show all outputs</a>
<div class='log' id="Output-1127178392">
用例ID: 4<br/>
用例名称: 使用正确的账号，空值的密码，无法正常登录成功，且接口返回的实际结果都正确<br/>
请求地址: http://120.79.232.23:8000/api/user/login<br/>
请求方式: POST<br/>
请求参数: username=admin&password=<br/>
返回结果: {"password":["该字段不能为空。"],"code":400}<br/>
</div>
</td>
<td><div><pre>java.lang.AssertionError: msg =&gt;Expected 【密码不能为空】 but found 【null】
	at org.testng.Assert.fail(Assert.java:94)
	at com.jmoney.luckeylink.handler.Login_Handler.checkEquals(Login_Handler.java:312)
	at com.jmoney.luckeylink.handler.Login_Handler.Login(Login_Handler.java:288)
	at TestCases2.Login2.Case4(Login2.java:33)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
	at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:54)
	at org.testng.internal.InvokeMethodRunnable.run(InvokeMethodRunnable.java:44)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
</pre></div><a href='#' onClick='toggleBox("stack-trace1127178392", this, "Click to show all stack frames", "Click to hide stack frames")'>Click to show all stack frames</a>
<div class='stack-trace' id='stack-trace1127178392'><pre>java.lang.AssertionError: msg =&gt;Expected 【密码不能为空】 but found 【null】
	at org.testng.Assert.fail(Assert.java:94)
	at com.jmoney.luckeylink.handler.Login_Handler.checkEquals(Login_Handler.java:312)
	at com.jmoney.luckeylink.handler.Login_Handler.Login(Login_Handler.java:288)
	at TestCases2.Login2.Case4(Login2.java:33)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
	at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:54)
	at org.testng.internal.InvokeMethodRunnable.run(InvokeMethodRunnable.java:44)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
</pre></div></td>
<td>2</td>
<td>TestCases2.Login2@5649fd9b</td></tr>
</table><p>
<table width='100%' border='1' class='invocation-passed'>
<tr><td colspan='4' align='center'><b>PASSED TESTS</b></td></tr>
<tr><td><b>Test method</b></td>
<td width="30%"><b>Exception</b></td>
<td width="10%"><b>Time (seconds)</b></td>
<td><b>Instance</b></td>
</tr>
<tr>
<td title='TestCases2.Login2.Case1()'><b>Case1</b><br>Test class: TestCases2.Login2<br/>
<a href="#Output-1461437750" onClick='toggleBox("Output-1461437750", this, "Show output", "Hide output");'>Show output</a>

<a href="#Output-1461437750" onClick="toggleAllBoxes();">Show all outputs</a>
<div class='log' id="Output-1461437750">
用例ID: 1<br/>
用例名称: 使用正确的账号，正确的密码，可以正常登录成功，且接口返回的实际结果都正确<br/>
请求地址: http://120.79.232.23:8000/api/user/login<br/>
请求方式: POST<br/>
请求参数: username=admin&password=admin369874125<br/>
返回结果: {"code":"999999","msg":"成功","data":{"first_name":"admin","last_name":"","phone":"12345678911","email":"admin@163.com","key":"640ca3dbb875b6cfe898bf0c9b0f45a921ef169b","date_joined":"2018-06-28 02:56:00","userphoto":"/file/userphoto.jpg"}}<br/>
用例结果: 〖first_name〗=>Expected: 【admin】, Actual: 【admin】<br/>
用例结果: 〖last_name〗=>Expected: 【】, Actual: 【】<br/>
用例结果: 〖phone〗=>Expected: 【12345678911】, Actual: 【12345678911】<br/>
用例结果: 〖email〗=>Expected: 【admin@163.com】, Actual: 【admin@163.com】<br/>
用例结果: 〖key〗=>Expected: 【640ca3dbb875b6cfe898bf0c9b0f45a921ef169b】, Actual: 【640ca3dbb875b6cfe898bf0c9b0f45a921ef169b】<br/>
用例结果: 〖date_joined〗=>Expected: 【2018-06-28 02:56:00】, Actual: 【2018-06-28 02:56:00】<br/>
用例结果: 〖userphoto〗=>Expected: 【/file/userphoto.jpg】, Actual: 【/file/userphoto.jpg】<br/>
</div>
</td>
<td></td>
<td>4</td>
<td>TestCases2.Login2@5649fd9b</td></tr>
<tr>
<td title='TestCases2.Login2.Case5()'><b>Case5</b><br>Test class: TestCases2.Login2<br/>
<a href="#Output-2071723932" onClick='toggleBox("Output-2071723932", this, "Show output", "Hide output");'>Show output</a>

<a href="#Output-2071723932" onClick="toggleAllBoxes();">Show all outputs</a>
<div class='log' id="Output-2071723932">
用例ID: 5<br/>
用例名称: 使用错误的账号，错误的密码，无法正常登录成功，且接口返回的实际结果都正确<br/>
请求地址: http://120.79.232.23:8000/api/user/login<br/>
请求方式: POST<br/>
请求参数: username=123456&password=123456789<br/>
返回结果: {"code":"999984","msg":"账号或密码错误"}<br/>
用例结果: 〖msg〗=>Expected: 【账号或密码错误】, Actual: 【账号或密码错误】<br/>
</div>
</td>
<td></td>
<td>2</td>
<td>TestCases2.Login2@5649fd9b</td></tr>
<tr>
<td title='TestCases2.Login2.Case6()'><b>Case6</b><br>Test class: TestCases2.Login2<br/>
<a href="#Output-826642369" onClick='toggleBox("Output-826642369", this, "Show output", "Hide output");'>Show output</a>

<a href="#Output-826642369" onClick="toggleAllBoxes();">Show all outputs</a>
<div class='log' id="Output-826642369">
用例ID: 6<br/>
用例名称: 使用错误的账号，正确的密码，无法正常登录成功，且接口返回的实际结果都正确<br/>
请求地址: http://120.79.232.23:8000/api/user/login<br/>
请求方式: POST<br/>
请求参数: username=123456&password=admin369874125<br/>
返回结果: {"code":"999984","msg":"账号或密码错误"}<br/>
用例结果: 〖msg〗=>Expected: 【账号或密码错误】, Actual: 【账号或密码错误】<br/>
</div>
</td>
<td></td>
<td>2</td>
<td>TestCases2.Login2@5649fd9b</td></tr>
<tr>
<td title='TestCases2.Login2.Case7()'><b>Case7</b><br>Test class: TestCases2.Login2<br/>
<a href="#Output-2029674224" onClick='toggleBox("Output-2029674224", this, "Show output", "Hide output");'>Show output</a>

<a href="#Output-2029674224" onClick="toggleAllBoxes();">Show all outputs</a>
<div class='log' id="Output-2029674224">
用例ID: 7<br/>
用例名称: 使用正确的账号，错误的密码，无法正常登录成功，且接口返回的实际结果都正确<br/>
请求地址: http://120.79.232.23:8000/api/user/login<br/>
请求方式: POST<br/>
请求参数: username=admin&password=123456789<br/>
返回结果: {"code":"999984","msg":"账号或密码错误"}<br/>
用例结果: 〖msg〗=>Expected: 【账号或密码错误】, Actual: 【账号或密码错误】<br/>
</div>
</td>
<td></td>
<td>2</td>
<td>TestCases2.Login2@5649fd9b</td></tr>
</table><p>
</body>
</html>